﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AzureReader.Web._Default" %>

<%@ Import Namespace="AzureReader.BLL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Azure Reader</title>
    <link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="wrap">
        <div id="top">
        </div>
        <div id="content">
            <div class="header" valign="center">
                <table>
                    <tr onclick="javascript:window.location='Default.aspx';">
                        <td style="cursor: pointer">
                            <h1>
                              Azure Reader</h1>
                        </td>
                        <td>
                            <img src="images/orange.gif" />
                        </td>
                    </tr>
                    <tr>
                    <td colspan="2">
                                <h2>Your Cloud Based RSS Feed Reader</h2></td>
                    </tr>
                </table>
            </div>
            <div>
                
                <p>
                <br />
                    <% if (UserId == null)
                       { %>
                    You are not signed in! Click the <b>Sign in</b> button to sign in using you LiveID.
                    
                    <% } %>
                    <iframe id="WebAuthControl" name="WebAuthControl" src="http://login.live.com/controls/WebAuthButton.htm?appid=<%=AppId%>&style=font-size%3A+10pt%3B+font-family%3A+verdana%3B+background%3A+white%3B"
                    width="80px" height="20px" marginwidth="0" marginheight="0" align="middle" frameborder="0"
                    scrolling="no"></iframe>
                </p>
            </div>
            <div class="middle" width="100%">
                <asp:Panel runat="server" ID="pnlControls">
                    <table width="100%">
                        <tr>
                            <td colspan="2">
                                <asp:TextBox runat="server" Width="300" ID="txtSubscription"></asp:TextBox>
                                <asp:Button runat="server" ID="btnAdd" Text="Add Subscription" OnClick="btnAdd_Click" /> (RSS or Atom feed Url)
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                <div style="width: 150px; height: 400px; overflow: auto;">
                                    <asp:Repeater runat="server" ID="lstSubs">
                                        <ItemTemplate>
                                            <asp:PlaceHolder ID="itemPlaceholder" runat="server">
                                               <img src="images/small.gif" /> 
                                               <asp:LinkButton runat="server" ID="lnkFeed" Text='<%# GetFeedCaption(Container.DataItem as vwSubscription) %>'
                                                    CommandArgument='<%# Eval("FeedUrl") %>' OnClick="lnkFeed_Click"></asp:LinkButton>
                                                    <br />
                                            </asp:PlaceHolder>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </div>
                            </td>
                            <td valign="top">
                                <div style="padding-left: 5px; width: 700px; height: 400px; background-color: #ffffff; overflow: auto;">
                                    <asp:Repeater runat="server" ID="grdItems">
                                        <ItemTemplate>
                                            <div id="itemContainer"  >
                                                <h3>
                                                    <a href='<%#Eval("FeedItemUrl") %>' target="_blank">
                                                        <%# Eval("Title") %></a></h3>  
                                                        
                                                        <h6>Posted By <%# Eval("Author")%> On <%# Eval("PublishDate")%></h6>
                                                         
                                                <input type="hidden" id="hdnID" />
                                                <input type="hidden" id="hdnContentBlobUri" />
                                                <input type="hidden" id="hdnPartitionKey" />
                                                <input type="hidden" id="hdnRowKey" />
                                                <div>
                                                    <%# Eval("Title")%>
                                                </div>
                                                 
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </div>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
            <div id="clear">
            </div>
        </div>
        <div id="bottom">
        </div>
    </div>
    <div id="footer" align="center">
        Powered By <a href="http://www.azure.com">Microsoft Windows Azure™</a>
        <br />
        Copyright © 2009 <a href="http://www.mosallem.com">www.mosallem.com</a>. All Rights Reserved.
    </div>
    </form>
</body>
</html>
